<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
                             "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:c="http://java.sun.com/jstl/core"
	xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:a="http://richfaces.org/a4j"
	xmlns:mtg="http://www.patelski.myself/jsf"
	xmlns:rich="http://richfaces.org/rich">
	<rich:panel styleClass="#{card.color} quickPanel"
		rendered="${!empty card}">
		<f:facet name="header">
			<h:outputText value="#{card.cardName}"></h:outputText>
		</f:facet>
		<h:panelGrid columns="2" columnClasses="cardData, cardPicture">
			<h:panelGrid columns="1">
				<h:outputText value="#{card.cardName}" />
				<h:outputText value="#{card.type}" />
				<h:outputText value="#{card.edition.name}" />
				<h:outputText value="#{card.cost}" />
				<h:outputText value="#{card.foil.description}" />
				<h:outputText value="#{card.powerToughness}" />
				<s:button view="/#{empty from ? 'Card' : from}.xhtml" value="Select"
					id="card">
					<f:param name="cardId" value="#{card.id}" />
				</s:button>
				<a:form rendered="#{identity.loggedIn}">
					<a:outputPanel id="addCardPopupPanel">
						<a:commandButton value="Add..." reRender="addCardPopupGrid"
							ajaxSingle="true" action="#{inventoryHome.setAddCardId(card.id)}"
							oncomplete="Richfaces.showModalPanel('addCardPopup', {})">
						</a:commandButton>
					</a:outputPanel>
				</a:form>


			</h:panelGrid>
			<h:panelGrid columns="1">
				<!-- mtg:photo src="#{card.picture}"
					missingSrc="/img/CardImageMissing.jpg" width="100" / -->
				<h:graphicImage style="width:125px;height:187;"
					url="http://localhost:8080/mtg-cardpictures-#{card.edition.id}/#{card.cardNameEncoded}.full.jpg" />

			</h:panelGrid>
		</h:panelGrid>
	</rich:panel>
</ui:composition>